package Leetcode;

public class Leetcode_161 {
    public static String generateTheString(int n) {
        StringBuffer sb = new StringBuffer();
        if (n % 2 == 1) {
            return sb.append("a".repeat(n)).toString();
        }
        return sb.append("a".repeat(n - 1)).append("b").toString();
    }

    public static void main(String[] args) {
        int n = 4;
        System.out.println(generateTheString(n));
    }
}
